package com.lnb.service.impl;

import com.lnb.entity.Roles;
import com.lnb.entity.UserRoles;
import com.lnb.mapper.UserrolesMapper;
import com.lnb.service.IUserRolesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liningbo
 * @since 2020-05-21
 */
@Service
public class UserRolesServiceImpl extends ServiceImpl<UserrolesMapper, UserRoles> implements IUserRolesService {
	
	@Autowired
	UserrolesMapper mapper;

	@Override
	public List<Roles> getRolesByUserId(Integer uid) {
		return mapper.getRolesByUserId(uid);
	}
	

	@Override
	public boolean removeRolesByUserId(Integer userId, String roleIds) {
		String[] arr = roleIds.split(",");
		return mapper.removeRolesByUserId(userId,arr);
	}

	
	
}
